{
 "cells": [
  {
   "cell_type": "code",
   "id": "initial_id",
   "metadata": {
    "collapsed": true,
    "ExecuteTime": {
     "end_time": "2025-09-10T11:29:01.290105Z",
     "start_time": "2025-09-10T11:29:01.286944Z"
    }
   },
   "source": [
    "s = 'a\\nb\\tc'\n",
    "s = 'd' + s[1:]\n",
    "s.replace('a', 'd')\n",
    "print(s)\n",
    "# 字符串的格式化\n",
    "id = '33'\n",
    "name = 'jian'\n",
    "print('id:{},name:{}'.format(id,name))\n",
    "print('id:%s,name:%s' % (id,name))"
   ],
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "d\n",
      "b\tc\n",
      "id:33,name:jian\n",
      "id:33,name:jian\n"
     ]
    }
   ],
   "execution_count": 1
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
